<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue.js"></script>
</head>
<body>
<div id="div_id">
    <!--通过key来解决标签被复用的问题-->
    <div v-if="account">账号登录：<input type="text" placeholder="账号" key="username"></div>
    <div v-else>邮箱登录：<input type="text" placeholder="邮箱" key="email"></div>
    <button @click="changeLogin">切换</button>
</div>

<script>
    const app=new Vue({
        el:"#div_id",
        data:{
            account:true
        },
        methods:{
            changeLogin(){
                this.account=!this.account;
            }
        }
    })
</script>

</body>
</html>